﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_COM_PGM_Get_Pgm_Class_By_Access_Level')
	BEGIN
		DROP Procedure usp_UPDMS_COM_PGM_Get_Pgm_Class_By_Access_Level
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO

/******************************************************************************
**	Name : usp_UPDMS_COM_PGM_Get_Pgm_Class_By_Access_Level
**	Desc : 접근권한별 프로그램분류명 조회
**	Test Exec Query : Exec usp_UPDMS_COM_PGM_Get_Pgm_Class_By_Access_Level 'smstyle','1','ko'
**	Called by : Cfg_Dac_UPDMS_COM_PGM.cs
**	Program ID : Cfg2010r
**	Auth : 송시명
**	Date : 2014-01-17
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_COM_PGM_Get_Pgm_Class_By_Access_Level]
@ls_user_id nvarchar(20),
@ls_access_level nvarchar(1),
@ls_lang_set varchar(2)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON

SELECT UPPER(ucp.Pgm_Class) AS Pgm_Class,
       CASE @ls_lang_set WHEN 'ko' THEN ucp.Pgm_Nm
                         ELSE ucp.Pgm_Nm_Eng
       END Pgm_Nm
  FROM UPDMS_COM_PGM AS ucp WITH(NOLOCK)
 WHERE ucp.Pgm_Div = 'D'
   AND ucp.Use_Yn = 'Y'
   AND ucp.Access_Level >= @ls_access_level
 ORDER BY Dir_Depth

GO